<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>会员注册_中国根雕行业网</title>
    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
    <link href="../css/regist.css" type="text/css" rel="stylesheet">
    <link href="../css/style.css" type="text/css" rel="stylesheet">
</head>
<body>

<!--头部-->
<div class="top">
    <div class="top_box">
        <div class="top_box_left">
            <div class="black fw_b fs_12">欢迎光临中国根雕行业网</div>
        </div>
    </div>
</div>

<div class="content">
    <div class="content_top">
        <div class="logo" align="center">
            <img src="../img/logo.png" alt="中国根雕行业网">
        </div>

        <div class="tittle">
            忘记密码
        </div>
    </div>
</div>

<div class="line">
</div>


<div class="information bor">
    <div class="info_box">
        <h3>先正确回答预留问题</h3>
        <!--<span>如果忘记问题请联系工作人员</span>-->

        <div class="info">
            <div class="info_left">
                <span class="info_tit">预留问题：</span>
            </div>
            <div class="info_right">
               <sapn>您父亲的姓名？</sapn>
            </div>
        </div>

        <div class="info">
            <div class="info_left">
                <span class="info_tit">答案：</span>
            </div>
            <div class="info_right">
                <input type="text" class="info_in" id="userName" >
            </div>
        </div>
        <div class="bu white" onclick="checkAnswer()">验证答案</div>

<div id="update" style="display: none">
        <h3>验证通过，请输入您的新密码</h3>
        <div class="info">
            <div class="info_left">
                <span class="info_tit">新密码：</span>
            </div>
            <div class="info_right">
                <input type="password" class="info_in" id="userPwd"   onblur="checkPwd()">
            </div>
        </div>
        <div class="info">
            <div class="info_left">
                <span class="info_tit">确认新密码：</span>
            </div>
            <div class="info_right">
                <input type="password" class="info_in" id="againPwd"  onblur="checkApwd()" >
            </div>
        </div>
        <div class="bu white" onclick="updatePwd()">提交</div>
</div>
    </div>
</div>

<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript">
   function checkAnswer(){
        if(true){
            $("#update").show();
        }else{
            alert("答案错误");
        }
   }
   //    密码正则
   var de_pwd = /^[A-Za-z0-9]+$/;
   //    检验密码
   function checkPwd(){
      var userPwd = $.trim($("#userPwd").val());
       if ( userPwd!=""&&de_pwd.test(userPwd) == false) {
           alert("密码只能由字母和数字组成");
           return 2;
       }else{
           return 1;
       }
   }
   //    检验二次密码
   function checkApwd(){
     var  userPwd = $.trim($("#userPwd").val());
     var  againPwd = $.trim($("#againPwd").val());
       if (againPwd!=""&& userPwd!=againPwd){
           alert("两次密码不一致");
           return 2;
       }else{
           return 1;
       }
   }

    function updatePwd(){
        var  userPwd = $.trim($("#userPwd").val());
        var  againPwd = $.trim($("#againPwd").val());
        if( userPwd==""||againPwd==""){
            alert("请输入密码");
        }else if(checkPwd()+checkApwd()!=2){
            alert("信息有误，请核对确认");
        }else{

        }
    }



</script>



</body>
</html>